require(tidyverse)
require(tidyr)
require(knitr)
require(dplyr)
require(ggplot2)
require(gganimate)
# from github devtools::install_github('marcusvolz/mathart') require(mathart)
# devtools::install_github('cutterkom/generativeart') require(generativeart)
require(aRtsy)
LOSS OF ELECTRONS = OXIDATION: \(X^+ - e^- = Xº\)
1. Control Ephys Recording Solution (ND)
2. Positive Control: 50µM Glycine in ND
3. Pre-treatment: 5mM GSSG in ND
4. Co-Application 50µM Glycine + 5mM GSSG in ND
load GSSG data
f1 <- "https://raw.githubusercontent.com/slcornett/creative-data-visualization/main/data/2018-04-05_GSSG_Oxidation.csv"
gssg <- read_csv(f1, col_names = TRUE)
## Rows: 321761 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): time_s, GSSG_Current_µA
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
gssg <- gssg %>%
filter(time_s >= 1000, time_s <= 2000) # make it slightly less giant
head(gssg)
## # A tibble: 6 × 2
## time_s GSSG_Current_µA
## <dbl> <dbl>
## 1 1000 0.0292
## 2 1000. 0.0262
## 3 1000. 0.0278
## 4 1000. 0.0281
## 5 1000. 0.0261
## 6 1000. 0.0294
# static plot
gssg_p1 <- ggplot(data = gssg, aes(x = time_s, y = GSSG_Current_µA, color = GSSG_Current_µA)) + scale_color_continuous(type = "viridis") +
geom_jitter(show.legend = FALSE) + ggtitle("Oxidative Effect of GSSG on Glycine-Receptor") + theme_classic()
gssg_p1
# animated! like a heart beat
gssg_a1 <- ggplot(data = gssg, aes(x = time_s, y = GSSG_Current_µA, color = GSSG_Current_µA)) + scale_color_continuous(type = "viridis") +
geom_jitter(show.legend = FALSE) + ggtitle("Oxidative Effect of GSSG on Glycine-Receptor") + theme_classic() +
labs(x = "time (s): {frame_time}", y = "Current uA") + # gganimate labs(x = "time (s):
labs(x = "time (s): {frame_time}", y = "Current uA") + # gganimate {frame_time}", y = "Current
labs(x = "time (s): {frame_time}", y = "Current uA") + # gganimate uA") + # gganimate
transition_time(time = gssg$time_s) + shadow_wake(wake_length = 0.2, alpha = FALSE) + ease_aes("linear")
gssg_a1
# with a trace
gssg_a2 <- ggplot(data = gssg, aes(x = time_s, y = GSSG_Current_µA, color = GSSG_Current_µA)) + scale_color_continuous(type = "viridis") +
geom_jitter(show.legend = FALSE) + ggtitle("Oxidative Effect of GSSG on Glycine-Receptor") + theme_classic() +
labs(x = "time (s): {frame_time}", y = "Current µA") + # gganimate labs(x = "time (s):
labs(x = "time (s): {frame_time}", y = "Current µA") + # gganimate {frame_time}", y = "Current
labs(x = "time (s): {frame_time}", y = "Current µA") + # gganimate µA") + # gganimate
transition_time(time = gssg$time_s) + shadow_wake(wake_length = 0.1, alpha = FALSE) + shadow_mark(alpha = 0.3,
size = 1) + ease_aes("linear")
gssg_a2
# gssg1 <- gssg %>% mutate('abGSSG_Current_µA' = abs(GSSG_Current_µA)) %>% gather(key = 'Current',
# value = 'value', abGSSG_Current_µA ) # collapses 2 variables into key-value pairs head(gssg1) try
# to plot two traces on the same plot gssg_p2 <- ggplot(data = gssg1, aes(x = time_s, y = Current),
# color = Current) + geom_line() + scale_color_continuous(type = 'viridis') gssg_p2
GAIN OF ELECTRIONS = REDUCTION: \(X^+ + e^- = Xº\)
1. Control Ephys Recording Solution (ND)
2. Positive Control: 50µM Glycine in ND
3. Pre-treatment: 5mM GSH in ND
4. Co-Application 50µM Glycine + 5mM GSH in ND
load GSH data
f2 <- "https://raw.githubusercontent.com/slcornett/creative-data-visualization/main/data/2018-04-12_GSH_Reduction.csv"
gsh <- read_csv(f2, col_names = TRUE)
## Rows: 237740 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): time_s, GSH_Current_µA
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(gsh)
## # A tibble: 6 × 2
## time_s GSH_Current_µA
## <dbl> <dbl>
## 1 0 0.0103
## 2 0.01 0.0102
## 3 0.02 0.0116
## 4 0.03 0.0103
## 5 0.04 0.0113
## 6 0.05 0.0109
gsh <- gsh %>%
filter(time_s >= 300, time_s <= 1600) # make it slightly less giant
# statics plot
gsh_p1 <- ggplot(data = gsh, aes(x = time_s, y = GSH_Current_µA, color = GSH_Current_µA)) + scale_color_continuous(type = "viridis") +
geom_jitter(show.legend = FALSE) + ggtitle("Reductive Effect of GSH on Glycine-Receptor") + theme_classic() +
labs(x = "time (s)", y = "Current (µA)")
gsh_p1
# animated! like a heart beat
gsh_a1 <- ggplot(data = gsh, aes(x = time_s, y = GSH_Current_µA, color = GSH_Current_µA)) + scale_color_continuous(type = "viridis") +
geom_jitter(show.legend = FALSE) + ggtitle("Reductive Effect of GSH on Glycine-Receptor") + theme_classic() +
labs(x = "time (s): {frame_time}", y = "Current (µA)") + # gganimate labs(x = "time (s):
labs(x = "time (s): {frame_time}", y = "Current (µA)") + # gganimate {frame_time}", y =
labs(x = "time (s): {frame_time}", y = "Current (µA)") + # gganimate "Current (µA)") + #
labs(x = "time (s): {frame_time}", y = "Current (µA)") + # gganimate gganimate
transition_time(time = gsh$time_s) + shadow_wake(wake_length = 0.2, alpha = FALSE) + ease_aes("linear")
gsh_a1
# with a trace
gsh_a2 <- ggplot(data = gsh, aes(x = time_s, y = GSH_Current_µA, color = GSH_Current_µA)) + scale_color_continuous(type = "viridis") +
geom_jitter(show.legend = FALSE) + ggtitle("Reductive Effect of GSH on Glycine-Receptor") + theme_classic() +
labs(x = "time (s): {frame_time}", y = "Current (µA)") + # gganimate labs(x = "time (s):
labs(x = "time (s): {frame_time}", y = "Current (µA)") + # gganimate {frame_time}", y =
labs(x = "time (s): {frame_time}", y = "Current (µA)") + # gganimate "Current (µA)") + #
labs(x = "time (s): {frame_time}", y = "Current (µA)") + # gganimate gganimate
transition_time(time = gsh$time_s) + shadow_wake(wake_length = 0.1, alpha = FALSE) + shadow_mark(alpha = 0.3,
size = 1) + ease_aes("linear")
gsh_a2